home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
ACORNUSERS
/
CBSA
/
EDUCATION
/
SAVER
/
cc
/
WimpPoll
< prev
next >
Wrap
Text File
|
1997-12-20
|
2KB
|
71 lines
//-----------------------------------
// WimpPoll.c
//-----------------------------------
#include <stddef.h> // NULL definition
#include <os.h>
#include <trap.h>
#include "WimpError.h"
#include "WimpPoll.h"
WimpPoll::WimpPoll()
{
mask_event = 0xE1831;
}
WimpPoll::~WimpPoll()
{
}
void WimpPoll::EnableEvent(Events e)
{
mask_event &= !(1 << e);
}
void WimpPoll::DisableEvent(Events e)
{
mask_event |= (1 << e);
}
void WimpPoll::run()
{
int r[10];
os_error *e;
bool quit = 0;
while (!quit)
{
r[0] = mask_event;
r[1] = (int) block;
if ((e = os_swi(Wimp_Poll, r)) != NULL) throw (e);
switch (r[0])
{
case ENULL : quit = NullEvent(); break;
case EREDRAW : quit = RedrawWindow(); break;
case EOPEN: quit = OpenWindow(); break;
case ECLOSE: quit = CloseWindow(); break;
case EPTRLEAVE: quit = PointerLeave(); break;
case EPTRENTER: quit = PointerEnter(); break;
case EBUT: quit = ButtonPressed(); break;
case EUSERDRAG: quit = UserDrag(); break;
case EKEY: quit = KeyPressed(); break;
case EMENU: quit = MenuSelected(); break;
case ESCROLL: quit = Scrolled(); break;
case ELOSECARET: quit = LoseCaret(); break;
case EGAINCARET: quit = GainCaret(); break;
case EPOLLNONZERO: quit = PollNonZero(); break;
case ESEND: quit = SendMsg(); break;
case ESENDWANTACK: quit = SendMsgAck(); break;
case EACK: quit = Acknowledge(); break;
default: quit = FALSE; break;
}
}
}